testsuite: Add cross-fade-in-opacity test
authorTimm Bäder <mail@baedert.org>
Wed, 24 Apr 2019 10:48:59 +0000 (12:48 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 5 May 2019 05:18:39 +0000 (07:18 +0200)
Making sure that an opacity node doesn't end up reviving a node that's
hidden because the cross-fade has progress 0 or 1.

testsuite/gsk/compare/cross-fade-in-opacity.node [new file with mode: 0644]
testsuite/gsk/compare/cross-fade-in-opacity.png [new file with mode: 0644]
testsuite/gsk/meson.build

diff --git a/testsuite/gsk/compare/cross-fade-in-opacity.node b/testsuite/gsk/compare/cross-fade-in-opacity.node
new file mode 100644 (file)
index 0000000..ff65e3a
--- /dev/null
@@ -0,0 +1,23 @@
+/* Background */
+color {
+  bounds: 0 0 200 200;
+  color: white;
+}
+
+/* It is important that the following node structure leaves the
+ * start child of the cross-fade node invisible. */
+opacity {
+  opacity: 0.4;
+
+  child: cross-fade {
+    start: color {
+      color: blue;
+      bounds: 0 0 100 100;
+    }
+    end: color {
+      color: red;
+      bounds: 100 100 100 100;
+    }
+    progress: 1.0;
+  }
+}
diff --git a/testsuite/gsk/compare/cross-fade-in-opacity.png b/testsuite/gsk/compare/cross-fade-in-opacity.png
new file mode 100644 (file)
index 0000000..83adbe7
Binary files /dev/null and b/testsuite/gsk/compare/cross-fade-in-opacity.png differ
index a9c8b4460a5f556cd7ecf5d673ce28663081e846..c045802c887b1684715ccd6c9c5c3aa68633a2af 100644 (file)
@@ -48,7 +48,6 @@ test('nodes (cairo)', test_render_nodes,
 
 # Interesting render nodes proven to be rendered 'correctly' by the GL renderer.
 gl_tests = [
-  ['cross fade in opacity',        'cross-fade-in-opacity'],
 ]
 
 foreach gl_test : gl_tests
@@ -69,6 +68,7 @@ endforeach
 compare_render_tests = [
   'clip-coordinates-3d',
   'clipped_rounded_clip',
+  'cross-fade-in-opacity',
   'opacity_clip',
   'outset_shadow_offset_both',
   'outset_shadow_offset_x',